<template>
  <el-row>
    <el-col :span="24">
      <Portlet title="商家信息">
        <el-form label-position="left" label-width="110px">
          <el-row>
            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="商家编号:">
                <span>{{ detail.code }}</span>
              </el-form-item>
            </el-col>

            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="商家名称:">
                <span>{{ detail.name }}</span>
              </el-form-item>
            </el-col>

            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="所属公司名称:">
                <span>{{ detail.compayName }}</span>
              </el-form-item>
            </el-col>

            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="商家联系人:">
                <span>{{ detail.prin }}</span>
              </el-form-item>
            </el-col>

            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="商家联系电话:">
                <span>{{ detail.phone }}</span>
              </el-form-item>
            </el-col>

            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="商家状态:">
                <span>{{ detail.state == 1 ? '启用' : '停用' }}</span>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div class="clearfix"></div>
      </Portlet>

      <Portlet title="账号信息">
        <el-form label-position="left" label-width="110px">
          <el-row>
            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label="账号姓名:">
                <span>{{ detail.userName }}</span>
              </el-form-item>
            </el-col>

            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label-width="120px" label="绑定登录手机号:">
                <span>{{ detail.userPhone }}</span>
              </el-form-item>
            </el-col>

            <el-col :lg="8" :md="12" :xl="6">
              <el-form-item label-width="120px" label="角色:">
                <span>{{ detail.roleName }}</span>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div class="clearfix"></div>
      </Portlet>

      <Productions :id="id"></Productions>

      <Portlet>
        <el-row class="row">
          <el-col :span="24" class="text-center">
            <el-button @click.prevent="toEdit" type="primary">修改</el-button>
          </el-col>
        </el-row>
      </Portlet>

    </el-col>
  </el-row>
</template>
<script>

import {httpGetResponse} from '@/utils/ajax'
import {filterDataBaseDictionary} from '@/filters'
import Productions from '@/views/oms/basicData/owner/Productions'

export default {
  name: 'WarehousingShow',
  components: {
    Productions
  },
  filters: {
    filterDataBaseDictionary
  },
  data() {
    return {
      id: this.$route.params.id,
      detail: {}
    }
  },
  created() {
    this.getData()
  },
  computed: {},
  methods: {
    getData() {
      httpGetResponse('/ms-warehouse-order/basicData/findCargoOwnerInfo', {id: this.id}).then(response => {
        if (!response.data) {
          return
        }
        this.detail = response.data || {}
      })
    },
    toEdit() {
      this.$router.push({path: '/ss-oms/basic-data/owner/edit/' + this.id})
    }
  }
}
</script>
